package com.ruoyi.checkingin.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.checkingin.mapper.EHolidayRecordMapper;
import com.ruoyi.common.core.domain.e_checkingin.EHolidayRecord;
import com.ruoyi.checkingin.service.IEHolidayRecordService;

/**
 * 员工请假记录Service业务层处理
 * 
 * @author JYW
 * @date 2024-01-30
 */
@Service
public class EHolidayRecordServiceImpl implements IEHolidayRecordService 
{
    @Autowired
    private EHolidayRecordMapper eHolidayRecordMapper;

    /**
     * 查询员工请假记录
     * 
     * @param id 员工请假记录主键
     * @return 员工请假记录
     */
    @Override
    public EHolidayRecord selectEHolidayRecordById(Long id)
    {
        return eHolidayRecordMapper.selectEHolidayRecordById(id);
    }

    /**
     * 查询员工请假记录列表
     * 
     * @param eHolidayRecord 员工请假记录
     * @return 员工请假记录
     */
    @Override
    public List<EHolidayRecord> selectEHolidayRecordList(EHolidayRecord eHolidayRecord)
    {
        return eHolidayRecordMapper.selectEHolidayRecordList(eHolidayRecord);
    }

    /**
     * 新增员工请假记录
     * 
     * @param eHolidayRecord 员工请假记录
     * @return 结果
     */
    @Override
    public int insertEHolidayRecord(EHolidayRecord eHolidayRecord)
    {
        eHolidayRecord.setCreateTime(DateUtils.getNowDate());
        return eHolidayRecordMapper.insertEHolidayRecord(eHolidayRecord);
    }

    /**
     * 修改员工请假记录
     * 
     * @param eHolidayRecord 员工请假记录
     * @return 结果
     */
    @Override
    public int updateEHolidayRecord(EHolidayRecord eHolidayRecord)
    {
        eHolidayRecord.setUpdateTime(DateUtils.getNowDate());
        return eHolidayRecordMapper.updateEHolidayRecord(eHolidayRecord);
    }

    /**
     * 批量删除员工请假记录
     * 
     * @param ids 需要删除的员工请假记录主键
     * @return 结果
     */
    @Override
    public int deleteEHolidayRecordByIds(Long[] ids)
    {
        return eHolidayRecordMapper.deleteEHolidayRecordByIds(ids);
    }

    /**
     * 删除员工请假记录信息
     * 
     * @param id 员工请假记录主键
     * @return 结果
     */
    @Override
    public int deleteEHolidayRecordById(Long id)
    {
        return eHolidayRecordMapper.deleteEHolidayRecordById(id);
    }
}
